MilkShape L3D Importer/Exporter Plug-Ins and CBN Builder Plug-In, v0.97 beta
(c) 2001 DragonZap, dragonzap1@aol.com
http://www.bwcenter.com/

These plug-ins for Milkshape are provided as-is, and I assume no
responsibility whatsoever for any damage they may cause.
I tried putting in basic range checking, but they may crash on bad
files. And then again maybe they won't.

HOW TO USE:
    1. Put the included "msL3DImporter.dll", "msL3DExporter.dll",
       "msBWCCompiler.dll", "FreeImag2.dll", and "msCPP.dll" files
       in your Milkshape program directory. (Overwriting the existing
       "msCPP.dll" of Milkshape 1.5.8 or earlier should be OK.)
    2. Run Milkshape. You'll find them listed under the "Import,"
       "Export," and "Tool" menus.

What the plug-ins CAN do
------------------------
Import existing L3D models
Allow you to export new meshes for L3D models which can be used in-game
Change some minor aspects of creatures, such as hair color and length,
and tattoo positions.

What the plug-ins CAN'T do
--------------------------
Import animations
Set eyeball and hair positions
Change the creature footprints
Change the creature skeletons and animations
Vertex blending

Details
-------

The import plug-in imports Black & White .L3D model files, although not
perfectly. You'll get a mesh with UV coordinates, and you can get a skeleton
with correct position information but lost rotation information. The problem
is that Black & White models use transformation matrices to show off their bone
positions, and such matrices also support scaling and skewing, which MilkShape
does not. This makes proper import a bit difficult. Sorry. On the other hand,
skeletons L3D files which have been exported from MilkShape originally can be
imported correctly without a problem.

Alpha textures are extracted but currently not assigned, as MilkShape seems
to have problems properly sorting polygons when alpha textures are enabled.
All textures are saved as .BMP files, currently.

When creating a model to be used in-game, you will probably want to use an
existing skeleton, since A) no .ANM importer/exporter has yet been written
at the time of this writing, and B) you can use the existing animations of
whatever model you intend to replace. To do this, you will want to import
the existing skeleton using the "Import without rotation information" option
to get the correct bone positions. Although you should be able to rename bones
without problem, do not add/remove/rearrange the bones in any way, or this
process may not work. Anyways, after you create your model, you can assign
the bones to your vertices. When you go to export, make sure to select the
"Use existing skeleton" option, and select the file you originally got the
skeleton from. Due to some problems with MilkShape's texture filename handling,
your model file, your original skeleton file, and all your texture files
should probably be in the same directory, or you may find your exported
model has no textures.

Black & White uses 256x256 textures with RGBA4444 color format, which allows for
4096 colors and 16 alpha values. All colors will be quantized to fit this range.
Valid image formats are any of those supported by the FreeImage library.
(This is generally any of the ones MilkShape already supports, such as BMP,
TGA, etc.) If an image is not 256x256 pixels, it will be scaled to fit. Thus,
you should probably stick to 256x256 textures, lest you find your L3D files
either suddenly become massive or your textures don't quite have the quality
that you thought they did.

I'm not clear on how Black & White determines eyeball or hair positions,
(they're in the .CBN files, but I'm not sure what the exact meaning of the
fields is) so those are not yet supported.

Version history:
0.90	- First beta release
0.91	- Added support for texture extraction and assignment
0.95	- Fixed a few bugs, and released the exporter along with the importer
0.95a	- Fixed a stupid mistake on my part; sorry about the last one, folks.
	  ...but this is why it's still beta.
0.96	- Added support for preserving morph targets -- this means you can
	  create models based on existing meshes which will work with the
	  originals if you're so inclined. This also means you can replace
	  individual models (rather than all seven for creatures) and make
	  modifications to the hand meshes without the game crashing
	  (as far as I can tell).
0.97	- Added minor support for modifying .CBN files, as well as some simple
	  bone naming based on .CBN information. Different rendering modes are
	  now supported for export. Also turned most of the strings in the DLLs
	  to string tables, for those of you who know how to use resource
	  editors and want to translate the plug-ins into your own native
	  language.